package com.erp.enums;

/**
 * @ClassName : SubmitStatusEnum
 * @Description : 提交状态枚举(1.提交审批 2.审批通过 3.审批退回 4.完成 5.还原)
 * @Author : lst
 * @Date: 2020-11-10 19:46
 */
public enum SubmitStatusEnum {

    SUBMIT_APPROVE(1, "提交审批"),
    APPROVE_SUCCESS(2, "审批通过"),
    APPROVE_RETURN(3, "审批退回"),
    SUCCESS(4, "完成"),
    REDUCTION(5, "还原");

    /**
     * id
     */
    private int id;

    /**
     * 描述
     */
    private String desc;

    public int getId() {
        return id;
    }

    public String getDesc() {
        return desc;
    }

    SubmitStatusEnum(int id, String desc) {
        this.id = id;
        this.desc = desc;
    }

    /**
     * 通过id获取描述信息
     * @param id
     * @return
     */
    public static String getDescById(int id){
        for(SubmitStatusEnum submitStatusEnum : SubmitStatusEnum.values()){
            if(submitStatusEnum.getId() == id){
                return submitStatusEnum.getDesc();
            }
        }
        return "";
    }
}
